-
Notifications
You must be signed in to change notification settings - Fork 22
fix: migrate from deprecated io/ioutil and enhance Workbench compatib… #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ility tests Major Changes: - Replace io/ioutil with io and os packages across 10 files (14 function calls) * ioutil.ReadAll -> io.ReadAll * ioutil.ReadFile -> os.ReadFile * ioutil.WriteFile -> os.WriteFile * ioutil.ReadDir -> os.ReadDir - Remove duplicate start command registration in pkg/cmd/cmd.go Workbench Compatibility Enhancements: - Add comprehensive documentation to cli_output_compatibility_test.go - Add Test_ListWithOrgFlag to verify 'brev ls --org' support - Add Test_ShortHelpFlag to verify 'brev -h' works (Workbench uses this) - Add Test_VersionWithNoCheckLatestFlag for flag variation testing - Add Test_InstanceListColumnHeadersStability for critical column validation - Add Test_OrgListColumnHeadersStability for org list format - Add Test_CommandExistenceForWorkbench for comprehensive command checks - Improve Test_StartCommandFormat to explicitly verify --org flag All changes verified with successful build and test execution. Tests ensure backward compatibility with NVIDIA AI Workbench integration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the codebase by migrating from the deprecated io/ioutil package to the standard io and os packages, removes a duplicate command registration, and adds comprehensive Workbench compatibility tests with detailed documentation.
- Replaces all
io/ioutilfunction calls with their modern equivalents (io.ReadAll,os.ReadFile,os.WriteFile,os.ReadDir) - Removes duplicate
startcommand registration in command tree initialization - Adds 7 new integration tests with extensive documentation of NVIDIA AI Workbench dependencies
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/workspacemanagerv2/containermanager_test.go | Replace ioutil.ReadDir with os.ReadDir |
| pkg/store/workspace.go | Replace ioutil.ReadAll with io.ReadAll |
| pkg/store/file.go | Replace ioutil.ReadAll with io.ReadAll |
| pkg/store/authtoken.go | Replace ioutil.ReadAll with io.ReadAll |
| pkg/setupworkspace/setupworkspace.go | Replace ioutil.ReadFile and ioutil.WriteFile with os equivalents |
| pkg/mergeshells/mergeshells.go | Replace ioutil.ReadAll and ioutil.ReadDir with modern equivalents |
| pkg/integration/cli_output_compatibility_test.go | Add comprehensive Workbench compatibility tests and documentation |
| pkg/huproxyclient/huproxyclient.go | Replace ioutil.ReadAll with io.ReadAll |
| pkg/files/files.go | Replace ioutil.ReadAll and ioutil.WriteFile with modern equivalents |
| pkg/cmd/paths/paths.go | Replace ioutil.ReadDir with os.ReadDir |
| pkg/cmd/importideconfig/importideconfig.go | Replace ioutil.ReadDir with os.ReadDir |
| pkg/cmd/cmd.go | Remove duplicate start.NewCmdStart command registration |
| pkg/cmd/clipboard/clipboard_listener.go | Replace ioutil.ReadAll with io.ReadAll |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Add nolint:gosec comment for G204 warning in Test_CommandExistenceForWorkbench. The flagged code uses hardcoded test values in cmd.args, not user input, so the security warning is a false positive.
Remove trailing whitespace and fix indentation to comply with gofmt standards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…ility tests
Major Changes:
Workbench Compatibility Enhancements:
All changes verified with successful build and test execution. Tests ensure backward compatibility with NVIDIA AI Workbench integration.